/**
 * Author: w景洋.
 * Time: 2016/7/6 0006
 */
angular.module('module.coupon')
    .controller('CouponListController', CouponListController);
// 用户优惠券列表
CouponListController.$inject = ['CouponService'];
function CouponListController(CouponService) {
    var vm = this;
    vm.couponList = [];
    activate();

    //////

    function activate() {
        if (typeof(EnterChange) == "function") {
            EnterChange(3);
        }
        var timestamp = new Date().getTime();
        var receiverid = getCookie("_userId");
        CouponService.getByReceiverId(receiverid,0).$promise.then(function (couponList) {
            vm.couponList = couponList;
        }, function(error){
            //vm.couponList = [];
        });
    }
}
